import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginVue from "eslint-plugin-vue";

export default [{
    files: ["**/*.{js,mjs,cjs,ts,vue}"],
    rules: {
      indent: ["error", 4], // 设置缩进为4个空格
    },
  },
  {
    languageOptions: {
      globals: globals.browser
    }
  },
  pluginJs.configs.recommended,
  ...tseslint.configs.recommended,
  ...pluginVue.configs["flat/essential"],
  {
    files: ["**/*.vue"],
    languageOptions: {
      parserOptions: {
        parser: tseslint.parser,
      },
      rules: {
        indent: ["error", 4], // 对 Vue 文件也设置缩进为4个空格
      },
    },
  },
];